<%@ page import="net.comic.entities.Comment" %>

<g:hiddenField name="showCommentHidden" value="${params.kaka}" />

<div id="commentsDiv" class="hidden">
     <g:hasErrors bean="${commentInstance}">
	     <div class="errors"><g:renderErrors bean="${commentInstance}" as="list" /></div>
     </g:hasErrors>
     
     	<g:if test="${comicInstance.rateable == true }">
           <g:each in="${comicInstance?.comments}" var="commentInstance">
               <li>${commentInstance.comment} - ${commentInstance.commentedBy.name}</li>
           </g:each>
           <g:if test="${session.userLogged != null}">
	           <g:textArea id="comment" name="comment" rows="5" cols="100%" value="${fieldValue(bean: commentInstance, field: 'comment')}" />
	           <div class="buttons">
               		<span class="button"><g:actionSubmit class="comment" action="comment" value="${message(code: 'comment', 'default': 'COMMENT')}" /></span>
	           </div>
	       	</g:if>    
         </g:if>
</div>